Skip to content

fix(pm-console): the Android build never holds up a report, and a half-written copy is no copy - #12760

Merged
dezren39 merged 1 commit into
mainfrom
claude/pm-apk-report-backoff
Nov 23, 2026
Merged

dezren39 merged 1 commit into
mainfrom
claude/pm-apk-report-backoff

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

What this is

The last three commits of #12723 (the Android build kept at the edge) merged before any reviewer read them. I read them again against main. Two real faults, both fixed here.

1. A build that does not get through held up every report after it

The laptop's reports are how the edge knows the laptop is there. A report that carries the build is hundreds of kilobytes where every other report is a few; a report is given twenty seconds. On a connection too slow for that, the report failed, the next one was built the same way, and so on for as long as the edge still lacked the build. In that time no report arrived at all, so the edge took the laptop for gone while it was there.

  • A report that carried the build and did not get through, whether it was cut off or turned away, is followed at once by one without the build. The build is tried again ten minutes later. At worst one report in ten minutes is lost to it.
  • A build file that cannot be read is left out the same way. It used to stop the report.
  • Whether the build and the changed sections fit one report is measured on the report as sent, in bytes. It was estimated in characters; text outside ASCII is up to three bytes a character, so the estimate could pass a report the edge then refused as too large.
  • When the build goes alone, the sections it displaced follow at once instead of at the next ordinary report.

2. A half-written copy at the edge was handed out as the old build

The edge wrote a new build over the pieces of the old one and only then recorded the new build. If a write stopped half-way, pieces of two builds sat under the old record, and with the laptop away they were served as the old build. The old record is now removed before its pieces are touched: a half-written copy is no copy, the edge says it has none, serves nothing from it, and asks for the build again. Pieces left by a larger build are removed whether or not its record survived.

Checked

  • bun test: 156 pass (four new tests, one rewritten). bun run src/server.ts --check, the Worker bundle and wrangler deploy --dry-run pass.
  • Sixteen planted faults, each caught by a test: the count in characters instead of bytes, no hold after a failed report, a hold that never ends, a hold of ten seconds, a timeout not counted, a refusal not counted, every failed report blamed on the build, an unreadable build stopping the report, the four ways of not hurrying or always hurrying the next report, sections kept beside a build that goes alone, the old record left over pieces being rewritten (two ways), leftover pieces not removed.

Not checked

  • The laptop on a slow connection. The tests cut off or turn away reports over a size; the real build is about 450 kB.
  • Cloudflare's storage failing half-way through a write. The test makes the store refuse one piece.

https://claude.ai/code/session_01YLT5K1QVuzZjfWGFhXSSNF


Generated by Claude Code

…f-written copy is no copy

Found by reading the last three commits of #12723 again after they
merged unreviewed.

The host's reports are how the edge knows the laptop is there. A
report that carries the build is hundreds of kilobytes; on a connection
too slow to send it in the twenty seconds a report is given it failed,
and the next was built the same way, for as long as the edge lacked the
build. Meanwhile nothing arrived, and the edge took the laptop for gone.

- A report that carried the build and did not get through (cut off or
  turned away) is followed at once by one without it; the build is
  tried again ten minutes later.
- A build file that cannot be read is left out the same way instead of
  stopping the report.
- Whether the build and the changed sections fit one report is measured
  on the report as sent, in bytes. It was estimated in characters, and
  text outside ASCII is up to three bytes each.
- When the build goes alone, the sections it displaced follow at once.
- The edge removes the record of its copy before writing a new build
  over the copy's pieces, so a write that stops half-way cannot leave
  pieces of two builds to be handed out under the old record, and it
  removes a larger build's leftover pieces whether or not that record
  survived.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YLT5K1QVuzZjfWGFhXSSNF
@dezren39
dezren39 requested a review from a team as a code owner November 23, 2026 01:36
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 21 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ee797e46-19ab-4e97-b1e2-ecaa0a1be9f2
Commits

Reviewing files that changed from the base of the PR and between a9496cb and b41aa2e.

Files selected for processing: 5

  • doc/2026-11-22T11-10-00Z_architecture_pm_console_edge/2026-11-22T11-10-00Z_architecture_pm_console_edge.md
  • pm-stack/console/edge/README.md
  • pm-stack/console/edge/src/edge.ts
  • pm-stack/console/src/sync.ts
  • pm-stack/console/test/edge.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@dezren39
dezren39 merged commit 55f0bdd into main Nov 23, 2026
2 checks passed
@dezren39
dezren39 deleted the claude/pm-apk-report-backoff branch November 23, 2026 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants